/* eslint-disable */
import { legacy_createStore as createStore, applyMiddleware, compose } from 'redux'; // 引入createStore方法
import reducer from './reducer';
import thunk from 'redux-thunk';

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose; // redux调试代码
const enhancer = composeEnhancers(applyMiddleware(thunk));

// 如果想两个同时使用，需要使用增强函数。使用增加函数前需要先引入compose
const store = createStore(reducer, enhancer); // 创建数据存储仓库
export default store; //暴露出去